/*
package study.intconsulting.net.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

import study.intconsulting.repository.Udb;
import study.intconsulting.transform.Trans;
import study.intconsulting.vo.PcInfo;

public class IntServer_3rd implements Runnable{
	
	public static final int ServerPort = 9999;

	public void run(){
		try {
			System.out.println("Server Connecting...");
			ServerSocket serverSocket = new ServerSocket(ServerPort);
			while (true) {
				Socket socket = serverSocket.accept();
				try{
					BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
					//String str = in.readLine();
					
					System.out.println("str:"+in.readLine());
					String str ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><pcInfo><ip>192.168.30.162</ip><name>mac-pro</name><who/></pcInfo>";
					System.out.println("Send Message : " + str);

					// 서버의 ip와 name을 넣은 vo로 service호출
					PcInfo pcInfo = new PcInfo();
					
					String hostName = InetAddress.getLocalHost().getHostName();
					String hostAddress = InetAddress.getLocalHost().getHostAddress();

					// 메시지변환
					Trans trans = new Trans();
					pcInfo = trans.makePcInfo(str);
					
					pcInfo.setIp(hostAddress);
					pcInfo.setName(hostName);
					
					// 서비스호출..
					Udb udb = new Udb();
					udb.dataWrite(pcInfo);
					
					// 수신 메시지 생성
					String xml = trans.makeXML(pcInfo);
					System.out.println("xml : " + xml);
					
//					DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
//					dos.writeBytes(xml + '\n');
//					dos.flush();
					BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
					bufferedWriter.write(xml + '\n');
					bufferedWriter.flush();
				}catch (Exception e){
					e.printStackTrace();
				}finally{
					socket.close();
					System.out.println("Server Done.");
				}
			}
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub         
		Thread thread = new Thread(new IntServer_3rd());
		thread.start();
	}
}
*/